﻿$(function () {


    $('#ExchangeAID').change(CurrencyIntersection());

    //$('#ExchangeBID').change(CurrencyIntersection());




function CurrencyIntersection()
{
    var URL = $('#ArbitrageCurrencyIntersectionID').data('supportedcurrencieslistaction');
    $.getJSON(URL + '/' + $('#ExchangeAID').val() + '/' + $('#ExchangeBID').val(), function (data) {
        var items = '<option>Select a Currency Pair</option>';
        $.each(data, function (i, CurrencyPair) {
            items += "<option value='" + CurrencyPair.Value + "'>" + CurrencyPair.Text + "</option>";
            // state.Value cannot contain ' character. We are OK because state.Value = cnt++;
        });
        $('#CurrenciesID').html(items);
    });
}

});